def power():
    dicts="""sbxh
ysjbh
lsslqfq
lsslqfh
hjsd"""
    eles="""最大力(Fm)
抗拉强度(Rm)
上屈服强度(ReH)
下屈服强度(ReL)
断面收缩率(Z)
断裂总延伸率(At)
屈服点延伸率(Ae)
最大力塑性延伸率(Ag)
最大力总延伸率(Agt)
屈强比
断后伸长率(A)
弹性模量(E)
断后伸长率(A4D)
规定塑性延伸强度(Rp0.2)"""
    args="""d0
a0
b0
D00
L0
du1
du2
FeH
FeL
t
sylx
sygg
temp1
temp2
temp3
Fm1
Fp02
note"""
    eles=eles.split("\n")
    dicts=dicts.split("\n")
    args=args.split("\n")
    def gen():
        r=[]
        for one in eles:
            r.append("""{
                    "name": "%s",
                    "type": "item",
                    "alias": "%s",
                    "titleName": "%s"
                }""" % (one,one,one))
        eles_out=",".join(r)+","
        r=[]
        for one in dicts:
            r.append("""{
                    "alias": "%s",
                    "delimiter": "&",
                    "identifier": "%s"
                }""" % (one,one))
        dicts_out=",".join(r)
        r=[]
        for one in args:
            r.append("""{
            "name": "%s",
            "type": "args",
            "alias": "%s",
            "titleName": "%s"
        }""" % (one,one,one))
        args_out=",".join(r)        
        out="""{
    "col": [
        {
            "dict":[
                {
                    "alias": "二级方法",
                    "delimiter": "&",
                    "identifier": "ejff"
                },
                {
                    "alias": "二级分析技术",
                    "delimiter": "&",
                    "identifier": "ejfxjs"
                },
                {
                    "alias": "方法编号",
                    "delimiter": "&",
                    "identifier": "ffbh"
                },
                {
                    "alias": "试验员",
                    "delimiter": "&",
                    "identifier": "syy"
                },
                {
                    "alias": "一审人员",
                    "delimiter": "&",
                    "identifier": "ysry"
                },
                {
                    "alias": "一审时间",
                    "delimiter": "&",
                    "identifier": "yssj"
                },
                {
                    "alias": "仪器编号",
                    "delimiter": "&",
                    "identifier": "yqbh"
                },
                {
                    "alias": "实验员签名",
                    "delimiter": "&",
                    "identifier": "syyqm"
                },%s
            ],
            "isPK": "true",
            "name": "样品编号",
            "type": "sample",
            "alias": "SampleCode",
            "ifHandle": "false",
            "exeScript": "",
            "preHandle": "false",
            "titleName": "id",
            "rowFilterScript": "v.length()>=1"
        },
        %s
        %s
    ],
    "name": "拉伸",
    "start": {
        "dataMode": "fixed",
        "startRow": "1",
        "titleRow": "0",
        "findPosScript": ""
    },
    "charSet": "GBK",
    "special": {
        "specialSamples": "BLK"
    },
    "parserMode": "name",
    "parserSource": "file-excel"
}""" % (dicts_out,eles_out,args_out)
        f=open("power.json","w",encoding="utf-8")
        f.write(out)
        f.close()
    gen()
power()